<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<!--借入/归还记录模块（借入/归还记录列表）-->
<div th:fragment="m_borrowList" >
    <div class="panel panel-default" id="allBorrowList">
        <div class="panel-heading">借入/归还记录</div>
        <div class="panel-body">
            <!--顶部搜索框-->
            <div class="row">
                <div class="col-sm-4">
                    <div class="input-group">
                        <input type="text" class="form-control" placeholder="输入用户名或申请物品名" v-model="searchBorrow">
                        <span class="input-group-btn">
                            <button class="btn btn-default" type="button" @click="searchBorrowList">搜索</button>
                        </span>
                    </div>
                </div>
            </div>
        </div>
        <!--借入物品列表-->
        <table class="table table-hover table-condensed">
            <thead>
            <tr >
                <th>姓名</th>
                <th>借入物品</th>
                <th>数量</th>
                <th>单价</th>
                <th>总共金额</th>
                <th>最后状态时间</th>
                <th>归还数量</th>
                <th>损失金额</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr v-for="borrowList in borrowLists">
                <td>{{ borrowList.borrowinfo_user_truename }}</td>
                <td>{{ borrowList.borrowinfo_product_name }}</td>
                <td>{{ borrowList.borrowinfo_num }}</td>
                <td>￥{{ borrowList.borrowinfo_product_price }}</td>
                <td>￥{{ borrowList.borrowinfo_product_price*borrowList.borrowinfo_num }}</td>
                <td>{{ borrowList.borrowinfo_time }}</td>
                <td>{{ borrowList.borrowinfo_return_num }}</td>
                <td>￥{{ borrowList.borrowinfo_missprice }}</td>
                <td>
                    <span class="label label-warning" v-if="borrowList.borrowinfo_return==0">未归还</span>
                    <span class="label label-success" v-if="borrowList.borrowinfo_return==1">已归还</span>
                    <span class="label label-default" v-if="borrowList.borrowinfo_return==2">已挂失</span>
                </td>
                <td>
                    <button type="button" class="btn btn-default btn-xs"  v-if="userdata.user_authority>=3 && borrowList.borrowinfo_return==0" data-toggle="modal" data-target="#borrowReturnModal" @click="addBorrowinfoToTemp(borrowList)">归还</button>
                    <button type="button" class="btn btn-danger btn-xs"  v-if="(borrowList.borrowinfo_return==0 && userdata.user_authority>=3 )? true : (userdata.user_id==borrowList.borrowinfo_user_id && borrowList.borrowinfo_return==0)"  data-toggle="modal" data-target="#borrowMissModal" @click="addBorrowinfoToTemp(borrowList)">挂失</button>
                    <button type="button" class="btn btn-danger btn-xs"  v-if="userdata.user_authority==7 && borrowList.borrowinfo_return!=0" data-toggle="modal" data-target="#borrowDeleteModal" @click="addBorrowinfoToTemp(borrowList)">删除</button>
                </td>
            </tbody>
        </table>
        <!--分页导航栏-->
        <nav aria-label="Page navigation" style="text-align: center">
            <ul class="pagination">
                <li :class="{ 'disabled': pagination.pageNum==1 }">
                    <a href="#" aria-label="Previous" @click="jumpPage('pre')" >
                        <span aria-hidden="true">&laquo;</span>
                    </a>
                </li>
                <li v-for="i in pagination.navigatepageNums" :class="{ 'active': pagination.pageNum==i }"><a href="#" @click="jumpByNumber(i)">{{ i }}</a></li>
                <li :class="{ 'disabled': pagination.pageNum==pagination.pages }">
                    <a href="#" aria-label="Next" @click="jumpPage('next')">
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                </li>
            </ul>
        </nav>

    </div>
</div>
</html>